#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import EulerHelper
import math

def triangleGenerator(i):
    while True:
        return int(0.5 * i * (i+1))

minValue = 500
i = 1
n = triangleGenerator(i)

while EulerHelper.divisorCount(n) < minValue:
    i += 2
    n = triangleGenerator(i)

m = triangleGenerator(i-1)
if EulerHelper.divisorCount(m) >= minValue: print m
else: print n
